<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户管理</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="container">
        <h1>用户管理</h1>
        <form id="user-filter-form" method="POST" action="{{ url_for('filter_users') }}">
            <div class="form-group">
                <label for="user-tags">选择用户标签:</label>
                <select id="user-tags" name="user_tags" multiple>
                    {% for tag in tags %}
                        <option value="{{ tag.id }}">{{ tag.name }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="form-group">
                <label for="username">查询用户名:</label>
                <input type="text" id="username" name="username" placeholder="输入用户名">
            </div>
            <button type="submit">查询用户</button>
        </form>

        <div id="user-results">
            <h2>查询结果:</h2>
            <ul>
                {% for user in users %}
                    <li>{{ user.username }} - 标签: {{ user.tags }}</li>
                {% endfor %}
            </ul>
        </div>
    </div>
    <script src="{{ url_for('static', filename='js/script.js') }}"></script>
</body>
</html>